package com.wmwj.hxlj.controller;

import com.wmwj.hxlj.entity.Video;
import com.wmwj.hxlj.service.VideoService;
import com.wmwj.hxlj.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

@RestController
@RequestMapping("/video")
public class VideoController {
    @Autowired
    private VideoService videoService;

    @RequestMapping("/getVideoList")
    public Result<List<Video>> getVideoList() {
        return Result.success(null);
    }

    //上传视频
    @PostMapping("/uploadVideo")
    public Result<String> uploadVideo(@RequestParam Long userId, @RequestParam String title, @RequestParam("file") MultipartFile file) {
        return videoService.uploadVideo(userId, title, file);
    }
}
